package com.atguigu.gmall.item.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.concurrent.*;

@Configuration
public class ThreadPoolConfig {
    @Bean
    public ExecutorService executorService(){
        return new ThreadPoolExecutor(100,200,600, TimeUnit.MINUTES,new ArrayBlockingQueue<>(1000), Executors.defaultThreadFactory(),(Runnable r, ThreadPoolExecutor executor)->{
            System.out.println("异步任务失败");
        });
    }
}
